<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
  <h1><a href="{:U('index')}">返回列表</a></h1>
    <form class="checkoutform" action="{:U('insert')}" method="post">
    <table class="table table-bordered" align="center" width="100%" cellpadding="0" cellspacing="0">
   <tr valign="baseline">
      <td nowrap="nowrap" align="right">数据表名</td>
      <td><select onchange="getfieldlist(this);" name="tablename" id="tablename"><option value="">请选择</option> 
      <volist name="alltables" id="vo"> 
      <option value="{$vo}">{$vo}</option> 
      </volist>
      </select></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">字段名</td>
      <td id="fieldlist">
      <select name="fieldname">
      
      </select>
      
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">配置类型:</td>
      <td>
        <p>
          
          <label>
            <input name="type" type="radio" id="RadioGroup1_1" value="0" checked="checked" />
            文本框</label>
<br />
          <label>
            <input name="type" type="radio" id="RadioGroup1_3" value="1" />
            多行文本</label>
<br />
          <label>
            <input type="radio" name="type" value="2" id="RadioGroup1_2" />
            下拉框</label>
          <br />
          <label>
            <input name="type" type="radio" id="RadioGroup1_2" value="3" />
            编辑框</label>
          
          <br />
          <label>
            <input name="type" type="radio" id="RadioGroup1_2" value="4" />
            图片</label><br />
          <label>
            <input name="type" type="radio" id="RadioGroup1_2" value="5" <eq name="info['type']" value="5">checked="checked"</eq> />
            排序字段</label>
        </p></td>
    </tr>
    
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">表单元素代码(使用json)</td>
      <td><textarea name="_select" id="_select" cols="45" rows="5"></textarea></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">备注</td>
      <td><textarea name="remark" id="remark" cols="45" rows="5"></textarea></td>
    </tr>  
    <tr valign="baseline">
      <td colspan="2" align="center" nowrap="nowrap"><input type="submit" value="提交" /></td> 
    </tr>
  </table>
    </form>
  </div>
  <div class="clear"></div>
</div>
<script>
	function getfieldlist(e){
		$.post('{:U('getFields')}',{tablename:e.value},function(data){
			$('#fieldlist').html(data);
		},'html');
	}
</script>
</body></html>